<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    	<title>统战成员学习平台</title>
	    <link rel="stylesheet" type="text/css" href="../../css/base.css" />
	    <link rel="stylesheet" type="text/css" href="../../css/style.css" />
	</head>
	<body class="white">
		<div id='app' style="display:none" v-show="true">
			<transition-group name="list" tag="ul" class="notify_list">
				<li v-for="(item, index) of items" :key="item"
                    :class="{'is_read': item.isRead, 'ui_border_b': index < items.length - 1}"
					@click="detail(item)">
					<i :class="item.isRead?'icon_sound_grey':'icon_sound_red'"></i>
					<p class="title">系统提醒<span class="date">{{item.date}}</span></p>
					<p class="content">{{item.content}}</p>
				</li>
			</transition-group>
			<transition name="fade">
				<spinner v-if="loading"></spinner>
			</transition>
			<div v-if="!items.length" class="no_notify">
				<img src="../../image/no_notify.png">
				<p>暂无消息</p>
			</div>
		</div>
		<script type="text/javascript" src="../../script/api.js"></script>
		<script type="text/javascript" src="../../script/vue.min.js"></script>
		<script type="text/javascript" src="../../script/common.js"></script>
		<script type="text/javascript" src="../../script/layer_mobile/layer.js"></script>
		<script type="text/javascript">
		    new Vue({
				el: '#app',
		     	data: {
					id: 0,
					loading: false,
					items: []
		     	},
				mounted: function() {
		        	var $this = this;
		        	apiready = function() {
						$this.id = api.pageParam.id;
						$this.getList();

						onScrollToBottom(function () {
							$this.getList()
						})
                	}
		    	},
		    	methods: {
					getList: function() {
			        	var $this = this;
						if($this.loading) return;
						$this.loading = true;
						setTimeout(function() {
							[{
								id: 1,
                                content: '您的课程将于三天后接受，请尽快完成学习',
                                date: '1分钟前',
                                isRead: false
                            },{
								id: 2,
                                content: '您的课程将于三天后接受，请尽快完成学习，您的课程将于三天后接受，请尽快完成学习。',
                                date: '1分钟前',
                                isRead: false
                            },{
								id: 3,
                                content: '您的课程将于三天后接受，请尽快完成学习',
                                date: '1分钟前',
                                isRead: false
                            },{
								id: 4,
                                content: '您的课程将于三天后接受，请尽快完成学习，您的课程将于三天后接受，请尽快完成学习。',
                                date: '1分钟前',
                                isRead: true
                            },{
								id: 5,
                                content: '您的课程将于三天后接受，请尽快完成学习',
                                date: '1分钟前',
                                isRead: true
                            },{
								id: 6,
                                content: '您的课程将于三天后接受，请尽快完成学习，您的课程将于三天后接受，请尽快完成学习。',
                                date: '1分钟前',
                                isRead: true
                            }].forEach(function(item) {
								$this.items.push(item)
							})
							$this.loading = false;
						}, 300)
					},
					detail: function(item){
						openWin('./notifyDetail_win', {id: item.id})
					}
		    	}
		    });
		</script>
	</body>
</html>
